<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="templates/StakeholderPortalTemplateUnauthenticated.xhtml">

    <link href="./../resources/css/default.css" rel="stylesheet" type="text/css" />
    <link href="./../resources/css/tableLayout.css" rel="stylesheet" type="text/css" />

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="./../resources/css/default.css" rel="stylesheet" type="text/css" />
        <link href="./../resources/css/tableLayout.css" rel="stylesheet" type="text/css" />
        <title>#{bundle['stakeholder.register.title']}</title>
    </h:head>

    <ui:define name="loginContent">     
        <f:view beforePhase="#{stakeholderRegisterManagedBean.initIndustryType}">
            <p:panel id="panel" header="#{bundle['stakeholder.register.panel']}" >
                <p:messages />
                <table>
                    <tr height="45px">
                        <td width="300px">
                            <h:outputLabel id="stakeholderRegisterUsernameLabel" style="font-weight: bold" value="#{bundle['stakeholder.register.username.label']}"/>
                            <h:outputLabel style="font-weight: bold; color: red" value="*" />
                        </td>
                        <td>
                            <h:inputText required="true" label="stakeholder username" requiredMessage="#{bundle['stakeholder.register.username.required']}" 
                                         id="username" value="#{stakeholderRegisterManagedBean.stakeholder.username}" />

                        </td>
                        <td>
                            <p:message for="username" />
                        </td>
                    </tr>

                    <tr height="45px">
                        <td>
                            <h:outputLabel id="stakeholderRegisterPassword" style="font-weight: bold" value="#{bundle['touristAccount.password.label']}"/>
                            <h:outputLabel style="font-weight: bold; color: red" value="*" />
                        </td>
                        <td>
                            <p:password feedback="true" minLength="6" required="true" label="Password" requiredMessage="#{bundle['touristAccount.password.required']}" id="password" 
                                        value="#{stakeholderRegisterManagedBean.oldPassword}" >

                            </p:password>
                        </td>

                        <td>
                            <p:message for="password" />
                        </td>

                    </tr>


                    <tr height="45px">
                        <td>
                            <h:outputLabel id="stakeholderRegisterContactPersonLabel" style="font-weight: bold" value="#{bundle['stakeholder.register.contactperson.label']}"/>                              
                            <h:outputLabel style="font-weight: bold; color: red" value="*" />
                        </td>
                        <td>
                            <h:inputText required="true" label="Contact Person" requiredMessage="#{bundle['stakeholder.register.contactperson.required']}" id="contactPerson" value="#{stakeholderRegisterManagedBean.stakeholder.corpContactPerson}">
                            </h:inputText>
                        </td>
                        <td>
                            <p:message for="contactPerson" />
                        </td>
                    </tr>

                    <tr height="45px">
                        <td>
                            <h:outputLabel id="stakeholderRegisterCorpNameLabel" style="font-weight: bold" value="#{bundle['stakeholder.register.corporatename.label']}"/>                                                    
                            <h:outputLabel style="font-weight: bold; color: red" value="*" />
                        </td>
                        <td>
                            <h:inputText required="true" label="Corporate name" requiredMessage="#{bundle['stakeholder.register.corporatename.required']}" id="corpName" value="#{stakeholderRegisterManagedBean.stakeholder.corpName}">
                            </h:inputText>
                        </td>
                        <td>
                            <p:message for="corpName" />
                        </td>
                    </tr>
                     <tr height="45px">
                         <td>
                            <h:outputLabel id="stakeholderIndustry" style="font-weight: bold" value="#{bundle['stakeholder.register.industrytypename.headerText']}"/>
                            <!--remember to go and do local message!-->
                         </td>
                         <td>
                             <h:selectOneMenu id="stakeholderIndustryType" requiredMessage="#{bundle['industry.type.required']}" required="true" value="#{stakeholderRegisterManagedBean.industryType}" converter="industryTypeConverter">
                            <f:selectItems id="stakeholderselectedItems" value="#{enumIndustryType.listItems}"/>
                            </h:selectOneMenu>
                         </td>
                     </tr>

                    <tr height="45px">
                        <td>
                            <h:outputLabel id="stakeholderRegisterBizRegNumberLabel" style="font-weight: bold" value="#{bundle['stakeholder.register.businessregistrationnumber.label']}" />
                            <h:outputLabel style="font-weight: bold; color: red" value="*" />
                        </td>
                        <td>
                            <h:inputText required="true" label="Business Registration Number" requiredMessage="#{bundle['stakeholder.register.businessregistrationnumber.required']}" id="bizRegNumber" value="#{stakeholderRegisterManagedBean.stakeholder.bizRegNumber}">
                            </h:inputText>
                        </td>
                        <td>
                            <p:message for="bizRegNumber" />
                        </td>
                    </tr>

                    <tr height="45px">
                        <td>
                            <h:outputLabel id="stakeholderRegisterBlkNumber" style="font-weight: bold" value="#{bundle['stakeholder.register.blkNumber.label']}"/>
                            <h:outputLabel style="font-weight: bold; color: red" value="*" />
                        </td>
                        <td>
                            <h:inputText required="true" label="blkNumber" requiredMessage="#{bundle['stakeholder.register.blkNumber.required']}" id="blkNumber" value="#{stakeholderRegisterManagedBean.stakeholderAddress.blkNumber}">
                            </h:inputText>
                        </td>
                        <td>
                            <p:message for="blkNumber" />
                        </td>
                    </tr>

                    <tr height="45px">
                        <td>
                            <h:outputLabel id="stakeholderRegisterUnitNumberLabel" style="font-weight: bold" value="#{bundle['stakeholder.register.unitnumber.label']}"/>
                        </td>
                        <td>
                            <h:inputText label="unitNumber" required="true" id="unitNumber" value="#{stakeholderRegisterManagedBean.stakeholderAddress.unitNumber}">
                            </h:inputText>
                        </td>
                        <td>
                            <p:message for="unitNumber" />
                        </td>
                    </tr>


                    <tr height="45px">
                        <td>
                            <h:outputLabel id="stakeholderRegisterBuildingNameLabel" style="font-weight: bold" value="#{bundle['stakeholder.register.buildingname.label']}"/>
                        </td>
                        <td>
                            <h:inputText label="buildingName" id="buildingName" value="#{stakeholderRegisterManagedBean.stakeholderAddress.buildingName}">
                            </h:inputText>
                        </td>
                        <td>
                            <p:message for="buildingName" />
                        </td>
                    </tr>

                    <tr height="45px">
                        <td>
                            <h:outputLabel id="stakeholderRegisterStreetNameLabel" style="font-weight: bold" value="#{bundle['stakeholder.register.streetname.label']}"/>
                            <h:outputLabel style="font-weight: bold; color: red" value="*" />
                        </td>
                        <td>
                            <h:inputText required="true" label="streetName" requiredMessage="#{bundle['stakeholder.register.streetname.required']}" id="streetName" value="#{stakeholderRegisterManagedBean.stakeholderAddress.streetName}">
                            </h:inputText>
                        </td>
                        <td>
                            <p:message for="streetName" />
                        </td>
                    </tr>


                    <tr height="45px">
                        <td>
                            <h:outputLabel id="stakeholderRegisterPostalCodeLabel" style="font-weight: bold" value="#{bundle['stakeholder.register.postalcode.label']}"/>
                        </td>
                        <td>
                            <p:inputMask required="true" mask="999999" label="postalCode" requiredMessage="#{bundle['stakeholder.register.postalcode.required']}" id="postalCode" value="#{stakeholderRegisterManagedBean.stakeholderAddress.postalCode}"/>
                        </td>
                        <td>
                            <p:message for="postalCode" /> 
                        </td>
                    </tr>


                    <tr height="45px">
                        <td>
                            <h:outputLabel id="stakeholderRegisterPhoneNumberLabel" style="font-weight: bold" value="#{bundle['stakeholder.register.phonenumber.label']}"/>
                            <h:outputLabel style="font-weight: bold; color: red" value="*" />
                        </td>
                        <td>
                            <h:inputText required="true" label="Phone Number" requiredMessage="#{bundle['stakeholder.register.phonenumber.required']}" id="phoneNumber" value="#{stakeholderRegisterManagedBean.stakeholder.corpContactNumber}">
                            </h:inputText>
                        </td>
                        <td>
                            <p:message for="phoneNumber" />
                        </td>
                    </tr>


                    <tr height="45px">
                        <td>
                            <h:outputLabel id="stakeholderRegisterEmailLabel" style="font-weight: bold" value="#{bundle['stakeholder.register.emailaddress.label']}"/>
                            <h:outputLabel style="font-weight: bold; color: red" value="*" />
                        </td>
                        <td>
                            <h:inputText required="true" label="Email" requiredMessage="#{bundle['stakeholder.register.emailaddress.required']}" id="email" value="#{stakeholderRegisterManagedBean.stakeholder.corpEmail}">
                            </h:inputText>
                        </td>
                        <td>
                            <p:message for="email" />            
                        </td>
                    </tr>

                    <tr height="45px">
                        <td>
                            <h:outputLabel id="stakeholderRegisterFaxLabel" style="font-weight: bold" value="#{bundle['stakeholder.register.website.label']}"/>
                        </td>
                        <td>
                            <h:inputText label="Website" requiredMessage="#{bundle['stakeholder.register.website.required']}" id="fax" value="#{stakeholderRegisterManagedBean.stakeholder.corpFaxNumber}">
                            </h:inputText>
                        </td>
                        <td>
                            <p:message for="fax" />
                        </td>
                    </tr>

                </table>

                
                
                <p:ajaxStatus style="width:16px;height:16px;">
                    <f:facet name="start">
                        <h:graphicImage value="http://www.primefaces.org:8080/showcase/design/ajaxloading.gif" />
                    </f:facet>
                    <f:facet name="complete">
                        <h:outputText value="" />
                    </f:facet>
                </p:ajaxStatus>

                <p:commandButton id="stakeholderRegisterbtn" value="#{bundle['stakeholder.register.button']}" update="panel" actionListener="#{stakeholderRegisterManagedBean.register}" ajax="true" />
            </p:panel>
        </f:view>
    </ui:define>
</ui:composition>